import {
	defineStore
} from 'pinia'

export const useRefreshStore = defineStore('refresh', {
	state: () => ({
		shouldRefresh: false,
		refreshParams: null
	}),
	actions: {
		setRefresh(shouldRefresh, params = null) {
			console.log('---setRefresh 被调用----', shouldRefresh, params)
			this.shouldRefresh = shouldRefresh
			this.refreshParams = params
		},
		resetRefresh() {
			console.log('---resetRefresh 被调用----')
			this.shouldRefresh = false
			this.refreshParams = null
		}
	},
	persist: true // 如果需要持久化
})